﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DTO;
using DAO;
using Banking.Member;

namespace Banking.Nhân_viên
{
    public partial class frmTKTietKiem : Form
    {
        ThongTinTaiKhoanTietKiem uCtrl;
        TypeDemo _type;
        int _maTKC;
        public frmTKTietKiem(int maKH,TypeDemo type)
        {
            InitializeComponent();
            _maTKC = TaiKhoanChinhDA.GetByMaKH(maKH);
            _type = type;
        }

        private void frmTKTietKiem_Load(object sender, EventArgs e)
        {
            uCtrl = new ThongTinTaiKhoanTietKiem(_type);
            uCtrl.Init(_maTKC);
            pnMain.Controls.Add(uCtrl);
        }

        private void btnChiTiet_Click(object sender, EventArgs e)
        {
            if (uCtrl.dgvTaiKhoan.SelectedRows.Count == 1)
            {
                int maTK = int.Parse(uCtrl.dgvTaiKhoan.SelectedRows[0].Cells[1].Value.ToString());
                frmChiTietTKTK frm = new frmChiTietTKTK(0,maTK,1, _type);
                frm.ShowDialog();
            }
        }
    }
}
